//
//  YFDemoViewController.swift
//  仿新浪微博
//
//  Created by 杨帆 on 16/6/30.
//  Copyright © 2016年 杨帆. All rights reserved.
//

import UIKit

class YFDemoViewController: YFBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // 设置标题
        title = "第 \(navigationController?.childViewControllers.count ?? 0) 个"
    }

    // MARK: - 监听方法
    // 继续push新的控制器
    @objc private func showNext() {
        
      let vc = YFDemoViewController()
      
      navigationController?.pushViewController(vc, animated: true)
    }
}

extension YFDemoViewController {

    // 重写父类方法
    override func setupTableView() {
        
        super.setupTableView()
        // 设置右方按钮
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}
